package lhb.test.SC.common.util;

import java.util.Enumeration;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class PrintUtil {
	
	@SuppressWarnings("unchecked")
	public static void printRequestHeader(HttpServletRequest request){
		Enumeration<String> enums = request.getHeaderNames();
		System.out.println("request Headers ");
		while(enums.hasMoreElements()){
			String hn = enums.nextElement();
			System.out.println("	"+hn+" : "+request.getHeader(hn));
		}
	}
	
	@SuppressWarnings("unchecked")
	public static void printSession(HttpServletRequest request){
		HttpSession session = request.getSession();
		Enumeration<String> enums = session.getAttributeNames();
		System.out.println("session Attributes");
		while(enums.hasMoreElements()){
			String hn = enums.nextElement();
			System.out.println("	"+hn+" : "+session.getAttribute(hn));
		}
	}
}
